package guda.house.biz.form.village;

import guda.house.dal.dataobject.UnitDO;

import javax.validation.constraints.NotNull;

/**
 * Created by well on 15/11/13.
 */
public class UnitEditForm extends UnitForm{

    @NotNull(message = "不能为空")
    private Long unitId;

    public void initForm(UnitDO unitDO){
        setUnitId(unitDO.getUnitId());
        setBuildingId(unitDO.getBuildingId());
        setUnitName(unitDO.getUnitName());
    }

    public UnitDO toDO(){
        UnitDO unitDO = super.toDO();
        unitDO.setUnitId(unitId);
        return unitDO;
    }

    public Long getUnitId() {
        return unitId;
    }

    public void setUnitId(Long unitId) {
        this.unitId = unitId;
    }
}
